﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<div class="modal-dialog x-modal-dialog" style="width: 960px; margin-top: 100px;">

  <div class="modal-content">
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal">
        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
      </button>
      <h4 class="modal-title">Session&nbsp;-&nbsp;Edit Sub Session</h4>
    </div>
    
    <form class="form-horizontal ms-form" role="form" method="POST" action="${ctx.host}/sessions/${session.id}/schedulings/relation/sub-session">
    
      <input type="hidden" name="sessionId" value="${session.id}">
      <input type="hidden" name="_method" value="PATCH">
      <input type="hidden" name="subSessionA" value="">
      <input type="hidden" name="subSessionB" value="">
      
      <div class="modal-body sub-session-edit" style="padding: 0px; overflow: hidden;">
        
        <div class="col-xs-12 sub-session sub-session-a" style="border-bottom: 1px solid #eee; padding-bottom: 10px;">
          <p class="form-control-static" style="padding-left: 15px; margin-bottom: 5px; margin-top: 10px;">Sub Session A</p>
          <c:forEach var="group" items="${subSessionA}">
            <div class="col-xs-3">
              <div class="panel panel-default ihg-panel group-panel" data-group="${group.key}">
                <div class="panel-heading">
                  <span class="panel-titles">GROUP ${group.key}</span>
                </div>
                <div class="panel-body" style="padding: 0px;">
                  <table class="table table-bordered ihg-table-table" style="margin-bottom: 0px; text-align: center;">
                    <tbody>
                      <c:forEach var="participator" items="${group.value}" varStatus="status">
                        <tr>
                          <c:if test="${status.index == 0 or status.index == 2}">
                            <td rowspan="2" style="vertical-align: middle;">${participator.assessorName}</td>
                          </c:if>
                          <td>${participator.delegateName}</td>
                        </tr>
                      </c:forEach>
                    </tbody>
                  </table>
                </div>
              </div>
            </div>
          </c:forEach>
        </div>

        <div class="col-xs-12 sub-session sub-session-b" style="padding-bottom: 10px;">
          <p class="form-control-static" style="padding-left: 15px; margin-bottom: 5px; margin-top: 10px;">Sub Session B</p>
          <c:forEach var="group" items="${subSessionB}">
            <div class="col-xs-3">
              <div class="panel panel-default ihg-panel group-panel" data-group="${group.key}">
                <div class="panel-heading">
                  <span class="panel-titles">GROUP ${group.key}</span>
                </div>
                <div class="panel-body" style="padding: 0px;">
                  <table class="table table-bordered ihg-table-table" style="margin-bottom: 0px; text-align: center;">
                    <tbody>
                      <c:forEach var="participator" items="${group.value}" varStatus="status">
                        <tr>
                          <c:if test="${status.index == 0 or status.index == 2}">
                            <td rowspan="2" style="vertical-align: middle;">${participator.assessorName}</td>
                          </c:if>
                          <td>${participator.delegateName}</td>
                        </tr>
                      </c:forEach>
                    </tbody>
                  </table>
                </div>
              </div>
            </div>
          </c:forEach>
        </div>
        
      </div>
      
      <div class="modal-footer">
        <button type="submit" class="btn btn-success btn-shadow btn-shadow-success x-btn">Submit</button>
        <button type="button" class="btn btn-default btn-shadow btn-shadow-default x-btn" data-dismiss="modal">Cancel</button>
      </div>
      
    </form>
  </div>
</div>